<template>
  <div>
    <headers color='pink' bgc="green" title="购物车案例"></headers>
    <mygoods v-for="item in list" :key="item.id" :item="item"></mygoods>
    <footers></footers>
  </div>
</template>

<script>
import headers from "./components/MyHeader.vue"
import mygoods from "./components/MyGoods.vue"
import footers from "./components/MyFooter.vue"
export default {
  data () {
    return {
      list:[]
    }
  },
  created () {
    this.$axios({
      url:"/api/cart"
    }).then(res=>{
      console.log(res);
     this.list = res.data.list;
    })
  },
  components:{
    headers,
    mygoods,
    footers
  }

}
</script>

<style>

</style>